﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Baidu.API {
    internal class QueryString {
        private Dictionary<string, string> dict = new Dictionary<string, string>();
        public void Add(string key, string value) {
            dict.Add(key, value);
        }

        public void Remove(string key) {
            dict.Remove(key);
        }

        public override string ToString() {
            var result = new StringBuilder();
            foreach (var item in dict) {
                result.AppendFormat(@"{0}={1}&", item.Key, item.Value);
            }
            result.Length -= 1;
            return result.ToString();
        }
    }
}
